﻿using MediatR;
using RBAC.LuFang.API.Application.Command.UserCommand;
using RBAC.LuFang.Domain;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.UserHandler
{
    //用户显示
    public class UserSelectCommandHandler:IRequestHandler<UserSelectCommand, page>
    {
        private readonly IUserService _userService;

        public UserSelectCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        async Task<page> IRequestHandler<UserSelectCommand, page>.Handle(UserSelectCommand request, CancellationToken cancellationToken)
        {
            return await _userService.GetUser(request.pageindex,request.pagesize,request.uname);
        }
    }
}
